/*
 * @Author: 18163104359 2205227953@qq.com
 * @Date: 2024-01-25 10:05:51
 * @LastEditors: 18163104359 2205227953@qq.com
 * @LastEditTime: 2024-01-25 14:24:56
 * @FilePath: /umi/src/components/xh-components/x-icon/index.jsx
 * @Description: icon
 */
import React, { useState, useEffect } from "react";
import { createFromIconfontCN } from "@ant-design/icons/lib";
import "./index.less";
// 妈的 必须import导入 icon.js 不然报错 弄了我一个多小时 草
import jsa from "@/assets/iconAli/iconfont.js";
const IconFont = createFromIconfontCN({
  scriptUrl: jsa,
});
const XHicon = (props) => {
  const { color, icon, fontSize = "16", size = "16" } = props;

  const fontSizeCom = () => {
    const fontSizeR = fontSize.includes("px") ? fontSize : Number(fontSize) + "px";
    const sizeR = size.includes("px") ? size : Number(size) + "px";

    let i = fontSizeR || sizeR;
    return i;
  };

  return <IconFont type={`icon-${icon}`} />;
};
export default XHicon;
